import React, { Component } from 'react';
import {
    Text,
    View,
    ScrollView,
    StyleSheet
} from 'react-native';

import ScrollableTabView, { ScrollableTabBar, } from 'react-native-scrollable-tab-view';
import Tabloid2 from "./Tabloid2";
import Tabloid3 from "./Tabloid3";
export default class TopView extends Component {
    static navigationOptions = ({ navigation })=>({
        title:navigation.getParam('title'),
        headerTintColor:'white',
        headerStyle:{
            backgroundColor:'#d04542',
            height:50,
        },
    });
    constructor(props) {
        super(props)
    }
    render() {
        const { navigation }  = this.props;
        return (
            <ScrollableTabView
                tabBarUnderlineStyle={{backgroundColor:'#d04542',borderWidth: 0.5,borderColor:'#d04542',width:50,marginLeft: 22,height:2}}
                initialPage={ navigation.getParam('position')?navigation.getParam('position'):0 }
                tabBarBackgroundColor='#FFFFFF'
                tabBarActiveTextColor='#d04542'
                scrollWithoutAnimation={true}
                tabBarInactiveTextColor='#333333'
                tabBarTextStyle={{ fontSize: 13 }}
                renderTabBar={() => <ScrollableTabBar />}
            >
                <ScrollView style={{flex:1,backgroundColor:'white'}} tabLabel='图片新闻'>
                    <Tabloid2></Tabloid2>
                </ScrollView >
                <ScrollView style={{flex:1,backgroundColor:'white'}}  tabLabel='新闻播报'>
                    <Tabloid3></Tabloid3>
                </ScrollView >
            </ScrollableTabView>
        )
    }
}

const styles = StyleSheet.create({
    card:{
    }
});